<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.4"/>
<title>Parola for Arduino: Designing and Implementing new text effects</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="Hardware Icon.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">Parola for Arduino
   &#160;<span id="projectnumber">1.0</span>
   </div>
   <div id="projectbrief">Scrolling Text and Effects for Modular Parola Hardware</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.4 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
    </ul>
  </div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="index.html">Library for scrolling text effects using Parola hardware</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">Designing and Implementing new text effects </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>Each of the selected text effects is implemented as a function. This makes adding new effects easy.</p>
<p>The effects functions are implemented as finite state machines. The function is called with the frequency set by the setSpeed() method, and the class variable _fsmState holds the state from the last call.</p>
<p>Each function is divided into 2 parts, one implementing the text move IN to the display (when the parameter bIn is true) and the other when the text is moving OUT of the display (bIn false). The first part starts with the INITIALISE state and ends when the state is set to PAUSE. The second phase starts with a PAUSE state and ends when the state is set to END. Because the IN and OUT effects can be different for a display cycle, the function must not assume that the first part was ever called just before the second, as this is not likely to be the case. The first phase should always end when the text is in its final position and the second phase should assume the text is in its proper starting position when called. Aside from the INITIALISE state (set by the displayReset() method), all other state changes are under the control of the effect functions.</p>
<p>The effects functions can work in one of 2 ways</p>
<ul>
<li>Additive, where the animation frames are incrementally built up to the inal display. In the scenario, the function will need to use the getFirst and getNext methods as it builds up the display column by column.</li>
<li>Subtractive, where the final display is put into the buffers and the elements that are not yet visible are removed. The helper function commonPrint() is used to consistently display the end result.</li>
</ul>
<p>Which method is used depends on the animation and what is convenient to for the coder, and examples of both are found in the standard library text effects.</p>
<p>The Parola library is implemented using the MD_MAX72xx library for hardware control. The origin for the LED matrix is on the top right of the display. This makes the leftmost column coordinate a higher column number that the one on the far right. Sometimes this is not intuitive when coding and is worth remembering. Rows are numbered from top to bottom. </p>
</div></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Sun Jun 2 2013 11:34:18 for Parola for Arduino by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.4
</small></address>
</body>
</html>
